home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / docs / howto / recoverWrongMxFile < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  2.0 KB

  1. From: jhh@sprite.Berkeley.EDU (John H. Hartman)
  2. Date: Fri, 4 May 90 16:59:35 PDT
  3. X-Mailer: Mail User's Shell (7.0.4 1/31/90)
  4. To: sprite@sprite.Berkeley.EDU
  5. Subject: how to recover a file
  6.  
  7.  
  8. This is a brief tutorial on how to recover a file from an Mx log,
  9. just in case any of you have to do it.  I had started editing the
  10. file with mx on wednesday morning.  On Thursday evening the
  11. file had zero length.  I was still in the original editing session,
  12. however, so I had the log.  In order to reconstruct the file
  13. you must have a snapshot of the log and the file.  I was able to
  14. get these from Wednesday evening's dump.  Then you have to fiddle
  15. with the magic numbers at the top of the log.  The first line in
  16. the log file looks like this:
  17.  
  18. f -1       netRoute.c     9a1d 2640d646    29416
  19.  
  20. where the first two fields have unknown meaning, the third is the 
  21. filename, the fourth is the inode number, the fifth is the time
  22. when the log was created (I think) and the last is the offset
  23. into the log the last time the file was written out.  What you
  24. need to do is to copy the offset from the snapshot of the log
  25. into the current copy of the log.  This won't work if you were
  26. unlucky enough to write out the file inbetween the time when the
  27. log was dumped and when the file was dumped. Then you have to
  28. determine the inode number of the restored file and change
  29. the inode field of the log. Run mx on the file and type
  30. "undo recover <log>" at the command line. If you get the
  31. inode number wrong then mx will silently ignore the undo
  32. command.  If you get the offset wrong then mx may go into
  33. the debugger.  If everything goes correctly then you
  34. get your file back.
  35.  
  36. If you don't have a snapshot of the log then you need to
  37. get a snapshot of the file prior to the start of the
  38. editing session.  Change the inode number in the log,
  39. then change the offset to be the start of the log.  
  40. This is offset 218 and can be determined by starting an
  41. mx session and looking at the log.  Then use the undo
  42. command to role forward.
  43.  
  44. Hope this is helpful.
  45.  
  46. John
  47.